package com.atguigu.yygh.hosp.controller.admin;

import com.atguigu.yygh.common.result.R;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.model.hosp.Department;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*==========================================
      时 间:   2022-03-09
      讲 师:   刘  辉
      描 述:   尚硅谷教学团队
 ==========================================*/
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    //根据医院编号，查询医院所有科室列表

    @GetMapping("getDeptList/{hoscode}")
    public R getDepartmentList(@PathVariable String hoscode){
       List<DepartmentVo> departmentVoList= departmentService.getDepartmentList(hoscode);
       return R.ok().data("list",departmentVoList);
    }
}
